﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace WomanMotion.WebApi.Infrastructure.DataBaseCommon
{
    /// <summary>
    /// 通用查询参数
    /// </summary>
    public class QueryParameterBase
    {
        /// <summary>
        /// 页码
        /// </summary>
        [Required(ErrorMessage = "页码不能为空")]
        public int PageNum { get; set; }
        /// <summary>
        /// 每页显示条数
        /// </summary>
        [Required(ErrorMessage = "每页显示多少条不能为空")]
        [Range(1, 150, ErrorMessage = "每页显示多少条不能小于1或大于150")]
        public int PageSize { get; set; }
        /// <summary>
        /// 查询参数集合 例子{"conditionalList": [{"key": -1,"value": {"fieldName": "ProductName","fieldValue": "架子","conditionalType": 1}}]}
        /// </summary>
        public List<QueryConditionalList> ConditionalList { get; set; }

        /// <summary>
        /// 排序字段 "Id desc"
        /// </summary>
        public List<string> OrderBys { get; set; }
    }
}
